// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLCreateRoleStatement.h"
#include "../../visitor/SQLASTVisitor.h"

SQLCreateRoleStatement::SQLCreateRoleStatement()
{
}

SQLCreateRoleStatement::SQLCreateRoleStatement(DbType_ptr dbType)
    : SQLStatementImpl(dbType)
{
}

// @Override
void SQLCreateRoleStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLCreateRoleStatement)))
  {
    acceptChild(visitor, name);
  }
  visitor->endVisit(SharedObject(SQLCreateRoleStatement));
}

// @Override
SQLObject_list_ptr SQLCreateRoleStatement::getChildren()
{
  SQLObject_list_ptr children = std::make_shared<std::list<SQLObject_ptr>>();
  if (name != nullptr)
  {
    children->push_back(name);
  }
  return children;
}

SQLName_ptr SQLCreateRoleStatement::getName()
{
  return name;
}

void SQLCreateRoleStatement::setName(SQLName_ptr name)
{
  this->name = name;
}

BOOL_ptr SQLCreateRoleStatement::isIfNotExists()
{
  return ifNotExists;
}

void SQLCreateRoleStatement::setIfNotExists(BOOL_ptr ifNotExists)
{
  this->ifNotExists = ifNotExists;
}

// @Override
SQLDDLStatement::DDLObjectType SQLCreateRoleStatement::getDDLObjectType()
{
  return SQLDDLStatement::DDLObjectType::ROLE;
}
